﻿using AMAP.Domain;
using AMAP.ServiceClasses.Common;
using AMAP.ServiceInterfaces;
using AMAP.ServiceInterfaces.Common;
using System;
using System.Collections.Generic;
using System.Linq;

namespace AMAP.ServiceClasses
{
    public class RequestService : BaseRepositoryService<Request>, IRequestService
    {
        public RequestService(IDatabaseFactory databaseFactory)
            : base(databaseFactory)
        {
        }

        public IList<Request> GetRequestFrom(DateTime StartDate)
        {
            return this.dataContext.RequestSet.Where(r => r.CreationDate > StartDate && r.ProvidedQuantity > 0).ToList<Request>();
        }
    }
}
